package com.frxuexi.lib_base.http

import com.frxuexi.lib_base.entity.AddFocuseBean
import com.frxuexi.lib_base.entity.FocuseBean
import com.frxuexi.lib_base.entity.Res
import com.frxuexi.lib_base.entity.VideoBean
import com.frxuexi.lib_base.entity.VideoCommentBean
import com.frxuexi.lib_base.entity.VideoCommentBeanItem
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface VideoApiService {

    @GET("/videosimple/getRecommendSimpleVideo?pagesize=10")
    fun getVideos(@Query("page")page:Int):Flow<Res<VideoBean>>

    @GET("/comment/getCommentByUserId?datatype=0")
    fun getComments(@Query("itemid")itemid:Int):Flow<Res<VideoCommentBean>>

    @POST("/comment/publishComment")
    fun addComment(@Body body: RequestBody):Flow<Res<VideoCommentBeanItem>>

    @GET("/focuse/getFocusedByName")
    fun getFocuse(@Query("username")username:String):Flow<Res<FocuseBean>>

    @POST("/focuse/focuseByUsername")
    fun addFocuse(@Query("focusUserName")focusUserName:String,@Query("focusedUserName")focusedUserName:String):Flow<Res<AddFocuseBean>>

    @DELETE("/focuse/unFocuseByUsername")
    fun deleteFocuse(@Query("focusUserName")focusUserName:String,@Query("focusedUserName")focusedUserName:String):Flow<Res<Boolean>>
}